package com.ruoyi.job.remote;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.job.domain.OaPerson;
import com.ruoyi.job.remote.impl.FeignUserServiceImpl;
import com.ruoyi.system.api.domain.SysUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

@FeignClient(contextId = "feignUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = FeignUserServiceImpl.class)
public interface FeignUserService {
    /**
     * 注册用户信息
     *
     * @param sysUser 用户信息
     * @param source  请求来源
     * @return 结果
     */
    @PostMapping("/user/syncOaUser")
    public AjaxResult syncOaUser(@RequestBody List<OaPerson> oaPeople, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
